package datapack

import (
	"broker/interface/imodel"
	"broker/struct/model"
	"encoding/binary"
)

/**
 * @Description
 * @Author huan.wang
 * @Date 2021/4/30 11:20 上午
 **/

type UnSubscribeAckDataPack struct {
}

func NewUnSubscribeAckDataPack() *UnSubscribeAckDataPack {
	return &UnSubscribeAckDataPack{}
}

func (u UnSubscribeAckDataPack) Pack(message imodel.IMessage) ([]byte, error) {
	subAckMsg := message.(*model.UnSubscribeAckMessage)
	subAckData := make([]byte, 2)
	binary.BigEndian.PutUint16(subAckData, subAckMsg.PacketID)
	return subAckData, nil
}

func (u UnSubscribeAckDataPack) UnPack(bytes []byte) (imodel.IMessage, error) {
	panic("implement me")
}
